"""
随机初始化种群 
"""
import numpy as np


def initPops(nPop, nChr, lb, rb, Vmax, Vmin):
    """
    Paramas:
        :param nPop:
        :param nChr:
        :param lb:
        :param rb:
        :param Vmax:
        :param Vmin:
        :return: (100,3)维度的粒子群、三个方向上的速度
    """
    # [-1.5836888   1.24349783 -0.31061702]
    # ...
    pops = np.random.rand(nPop, nChr) * (rb - lb) + lb
    VPops = np.random.rand(nPop, nChr) * (Vmax - Vmin) + Vmin
    return pops, VPops
